package com.heima.Serivce;

import com.heima.Serivce.impl.ScheduleCillentFallBack;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.pojos.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(value = "HMTTScheduleService",fallback = ScheduleCillentFallBack.class)
public interface ScheduleCilent {
    @PostMapping("Schedule/add")
    public ResponseResult AddTask(@RequestBody Task task);

    @GetMapping("Schedule/execute/{taskType}/{priority}")
    public ResponseResult ExecuteTask(@PathVariable("taskType") Integer taskType,@PathVariable("priority") Integer priority);

    @GetMapping("Schedule/delete/{id}")
    public ResponseResult DeleteTask(@PathVariable long id);
}
